export default {
  state: {
    user: null, // 当前用户信息
    isLoggedIn: false, // 用户登录状态
    showLogin:false
  },
  getters:{
    getShowLogin(state){
      return state.showLogin
    }
  },
  mutations: {
    // 存储用户信息
    setUser(state, user) {
      state.user = user;
    },
    // 存储登录状态
    setLoggedIn(state, isLoggedIn) {
      state.isLoggedIn = isLoggedIn;
    },
    // 设置登录弹框的显隐
    setShowLogin(state,data){
      state.showLogin = data
    }
  },
  actions: {
    setShowLogin({commit},data){
      commit('setShowLogin',data)
    },
    setLoggedIn({commit},data){
      commit('setLoggedIn',data)
    }
  },
};
